A stator is the stationary component of an electric machine. The stator interacts with a rotor, which is the moving component of the electric machine. The stator and rotor allow the electric machine to convert mechanical energy to electrical energy (generator) and to convert electrical energy to mechanical energy (motor). Electric machines are capable of being operated in either generating or motoring modes, depending upon the control state. Some stators and rotors have permanent magnets and some have conductors or windings that provide electromagnetic fields.